<!-- 项目管理 -->
<template>
  <div class="page-box h100 display-flex czbj">
    <!-- <p class="title-label mb10">产品列表</p> -->
    <!-- sonRouter="yybureauFormationBJ" 为跳转新的页面编辑 -->
    <dxtable
      :dataJson="dataJson"
      :portUrl="portUrl"
      :formJson="formJson"
      :qx="qx"
      ref="databale"
    ></dxtable>
  </div>
</template>
<script lang="ts" setup>
import dxtable from "../../../components/util/dxtable.vue";
import sort from "../../../components/util/sort.vue";
import { dxget, dxpost } from "../../../util/index";
import { NButton, NImage, NTag } from "naive-ui";
import { h, ref, reactive } from "vue";
const databale = ref();
const initeer = () => {
  databale.value.initDataExpose();
};
let dataJson = [
  // {
  //   title: "分类",
  //   key: "fenlei",
  // },
  // {
  //   title: "二级分类",
  //   key: "flzid",
  // },
  {
    title: "P/N",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "xinghao",
    width: "",
    search: true,
    istable: true,
    required: false,
  },
  // {
  //   title: "特点",
  //   type: "input",
  //   val: "",
  //   icon: "dx-shurukuang",
  //   span: 12,
  //   key: "tedian",
  //   width: "",
  //   search: true,
  //   istable: true,
  //   required: false,
  // },
  {
    title: "频率(GHz)",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "zxcfedfa",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "增益(dB)",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "zxcfedfb",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "噪声",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "zxcfedfc",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "OP1(dBm）",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "zxcfedfd",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "功耗(mA)",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "zxcfedfe",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "封装/Die(mm)",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "zxcfedff",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "pdf",
    type: "pdf",
    val: "",
    icon: "dx-pdf",
    span: 12,
    key: "pdf",
    width: "",
    search: false,
    istable: true,
    required: false,
    render: (row) => {
      if (!row.pdf) {
        return h(
          "span",
          {
            class: "z9 fz12",
          },
          "请上传pdf"
        );
      }
      return h(
        "span",
        {
          class: "ls sz",
          onClick: () => {
            open(row.pdf);
          },
        },
        "点击查看"
      );
    },
  },
  {
    title: "排序",
    width: 100,
    render: (row) => {
      row.sjk = "gsjjxcx"; //数据库
      row.databaseName = "cpgli"; //表名
      return h(sort, {
        row,
        onCallBack: () => {
          initeer();
        },
      });
    },
  },
  {
    title: "添加时间",
    key: "addTime",
    width: 150,
  },
];

const qx = {
  DeletePermissionID: "gsjjcpglidel", //删除
  EditPermissionIdentifier: "gsjjcpglibj", // 编辑
  NewPermissionIdentifier: "gsjjcpglixz", // 新建
  ViewPermissionID: "gsjjcpglick", // 查看
};
const portUrl = "gsjjxcx/cpgli?fenlei=低噪声放大器&flzid=低噪声放大器";

let formJson = reactive([
  {
    title: "分类",
    val: "低噪声放大器",
    icon: "dx-shurukuang",
    span: 12,
    key: "fenlei",
    width: "",
    search: false,
    istable: true,
    required: true,
  },
  {
    title: "",
    val: "低噪声放大器",
    icon: "dx-shurukuang",
    span: 12,
    key: "flzid",
    width: "",
    search: false,
    istable: true,
    required: true,
  },
  {
    title: "P/N",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "xinghao",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  // {
  //   title: "特点",
  //   type: "input",
  //   val: "",
  //   icon: "dx-shurukuang",
  //   span: 12,
  //   key: "tedian",
  //   width: "",
  //   search: false,
  //   istable: true,
  //   required: false,
  // },
  {
    title: "频率(GHz)",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "zxcfedfa",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "增益(dB)",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "zxcfedfb",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "噪声",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "zxcfedfc",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "OP1(dBm）",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "zxcfedfd",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "功耗(mA)",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "zxcfedfe",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "封装/Die(mm)",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "zxcfedff",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "pdf",
    type: "pdf",
    val: "",
    icon: "dx-pdf",
    span: 12,
    key: "pdf",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
]);
const czFun = {
  fun: (row) => {
    return [
      h(
        NButton,
        {
          type: "info",
          quaternary: true,
          onClick: async (e) => {},
        },
        "复制代码"
      ),
    ];
  },
};

// 获取字典内容
// const xtgxxmfl = async () => {
//   const { data }: any = await dxget("gsjjxcx/api/jjmnxcr");
//   dataJson[0].options = [
//     {
//       label: "全部",
//       value: "",
//     },
//     ...data,
//   ];
//   formJson[0].options = data;
//   console.log(data);
// };
// xtgxxmfl();
</script>
<style scoped></style>
